import React from 'react';
import { Typography } from 'antd';

const DescItem = ({ text }) => {
    if (Array.isArray(text) && text.length > 0) {
        return text?.map(item => (
            <div key={item.scoreValue} style={{ display: 'flex', alignItems: 'center' }}>
                <Typography.Paragraph
                    ellipsis
                    style={{ width: 200, marginBottom: 0, marginRight: 8 }}
                    title={`${item.scoreValue}分：对应职级(${item.rankValues})`}
                >
                    {item.scoreValue}分：对应职级({item.rankValues})
                </Typography.Paragraph>
                <div style={{ flex: 1 }}>{item.comment}</div>
            </div>
        ));
    }
    return null;
};

export default DescItem;
